package com.platform.modules.user.service.impl;

import com.platform.common.datasources.DataSourceType;
import com.platform.common.datasources.annotation.DataSource;
import com.platform.modules.user.dao.SysUserDao;
import com.platform.modules.user.entity.SysUserEntity;
import com.platform.modules.user.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by cyn on 2019/2/25.
 */

@Service
public class SysUserServiceImpl implements SysUserService {

    @Autowired
    SysUserDao sysUserDao;

    @Override
    public List<SysUserEntity> list() {
        return sysUserDao.list();
    }

    @Override
    @DataSource(value = DataSourceType.MASTER)
    public SysUserEntity get() {
        return sysUserDao.get();
    }

    @Override
    @DataSource(value = DataSourceType.SLAVE)
    public SysUserEntity get2() {
        return sysUserDao.get2();
    }
}
